package logic

import (
	"context"
	"errors"
	"product_server/dao/dao_redis"
	product "product_server/proto"
)

// DelCar 清空购物车
func (p *ProductServer) DelCar(ctx context.Context, req *product.DelCarRequest) (*product.DelCarResponse, error) {
	//清空
	err := dao_redis.DelCar(req.Uid)
	if err != nil {
		return nil, errors.New("购物车清空失败")
	}
	return &product.DelCarResponse{Success: true}, nil
}
